public class Test2 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            while (!Thread.currentThread().isInterrupted()){
                System.out.println("F**k !");
                System.out.println(Thread.currentThread().isInterrupted());
                try{
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    System.out.println("捕捉到异常！"+Thread.currentThread().isInterrupted());
                    e.printStackTrace();
//                    break;
                    try {
                        Thread.sleep(1000);
                    }catch (InterruptedException ex){
                        ex.printStackTrace();
                    }
                }
            }
        });
        t.start();
        try{
            Thread.sleep(1000);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
        t.interrupt();
        t.interrupt();
    }
}
